#ifndef _INSTANCE_STATE_MACHINE_H__
#define _INSTANCE_STATE_MACHINE_H__

#include <vector>
#include "InstanceState.h"

class InstanceState;

class InstanceStateMachine
{
	typedef std::vector<InstanceState*>              InstantContainer;
	typedef std::vector<InstanceState*>::iterator    InstantIter;
public:

	static InstanceStateMachine* Instance();

	bool AddState(InstanceState* state);
	bool DelState(const std::string& stateName);
	bool TransToState(const std::string& stateName);
	void UpdateStateMachine(float deltaTime);

private:

	InstanceStateMachine();       //InstanceStateMachine is a singleton class..
	~InstanceStateMachine();

private:

	static InstanceStateMachine*       mStateMachine;     //Do not initial this parament,call Instance() func..
	InstantContainer                   mInsContainer;
	InstanceState*                     mPrevState;
	InstanceState*                     mCurrentState;
	InstanceState*                     mNextState;
};


#endif